<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html >
<html>
<head>
<%@ include file="/WEB-INF/view/jQgrid.jsp"%>
</head>
<body style="background-color: white;" class="gray-bg">
	<div class="ibox-content">
		<div class="row" id="content">
			
		</div>
	</div>
	<script type="text/javascript">
	$(function() {
		var id = '${id}';
		var classid = '${classid}';
		$.ajax({
			 url: '<%=contextPath%>/talentsRecommend/timeLineJson',
			 data:{
				 'classid':classid,
				 'id':id
				 },
			 type : 'post',
			 dataType : "json",
			 success : function(data) {
				 var htm="";
				 if(data.code==200){
					 if(classid == 1){
						 var recommends = data.recommend;
						 if(recommends!=null && recommends!=""){
							 htm ='<div class="col-sm-8"><h5>'+data.title+'</h5>';
							 htm +='<p>【推荐时间】:'+recommends.reportDate+'   【推荐理由】:'+recommends.reason+'</p>';
							 var recresults = data.results;
							 if(recresults!=null && recresults!=""){
								 htm +='<p>【推荐结果】:'+recresults.results+' 【原因】:${fns:getDictLabel('+recresults.status+','rec_status','')}</p></div>';	
							 }
						 }
						 
					 }else if(classid == 2 || classid == 3 || classid == 4){
						 var communicates = data.communicate;
						 if(communicates!=null && communicates!=""){
							 htm ='<div class="col-sm-8"><h5>'+data.title+'</h5>';
							 htm +='<p>【沟通时间】:'+communicates.communicationTime.substring(0,16) +'   【沟通目的】:'+communicates.purpose+'</p>';
							 htm +='<p>【沟通内容】:'+communicates.details+'</p>';
							 var list = data.list;
							 if(list!=null && list!=""){
								 for (var i = 0; i < list.length; i++) {
									htm +='<div class="col-sm-8"><h5>面试记录'+(i+1)+'</h5>'; 
									htm +='<p>【面试时间】:'+list[i].interDate.substring(0,16)+'  【面试地点】:'+list[i].addres+'</p>'; 
									htm +='<p>【面试注意事项】:'+list[i].notice+'</p>'; 
								    htm +='<p>【面试通知】:'+list[i].message+'</p></div>'; 
								}
							 }
						 }
					 }else if(classid == 5){
						 var communicates = data.communicate;
						 if(communicates!=null && communicates!=""){
							 htm ='<div class="col-sm-8"><h5>'+data.title+'</h5>';
							 htm +='<p>【沟通时间】:'+communicates.communicationTime.substring(0,16) +'   【沟通目的】:'+communicates.purpose+'</p>';
							 htm +='<p>【沟通内容】:'+communicates.details+'</p>';
							 var list = data.investigations;
							 if(list!=null && list!=""){
								 for (var i = 0; i < list.length; i++) {
									htm +='<div class="col-sm-8"><h5>背景调查'+(i+1)+'</h5>'; 
									htm +='<p>【调查时间】:'+list[i].surveyDate.substring(0,16)+'</p>'; 
									htm +='<p>【调查文件】:<a href="<%=contextPath%>'+list[i].reportDoc+'">'+list[i].reportDoc+'</a></p></div>'; 
								}
							 }
						 }
					 }else if(classid == 6){
						 var communicates = data.communicate;
						 if(communicates!=null && communicates!=""){
							 htm ='<div class="col-sm-8"><h5>'+data.title+'</h5>';
							 htm +='<p>【沟通时间】:'+communicates.communicationTime.substring(0,16) +'   【沟通目的】:'+communicates.purpose+'</p>';
							 htm +='<p>【沟通内容】:'+communicates.details+'</p>';
							 var list = data.offerRecords;
							 if(list!=null && list!=""){
								 for (var i = 0; i < list.length; i++) {
									htm +='<div class="col-sm-8"><h5>offer详情'+(i+1)+'</h5>'; 
									htm +='<p>【入职时间】:'+list[i].entryDate.substring(0,16)+' 【试用期】:'+list[i].probation+'</p>'; 
									htm +='<p>【入职岗位】:'+list[i].inPost+' 【入职薪酬】:'+list[i].entryPay+'</p></div>'; 
								}
							 }
						 }
					 }else if(classid == 7){
						 var communicates = data.communicate;
						 if(communicates!=null && communicates!=""){
							 htm ='<div class="col-sm-8"><h5>'+data.title+'</h5>';
							 htm +='<p>【沟通时间】:'+communicates.communicationTime.substring(0,16) +'   【沟通目的】:'+communicates.purpose+'</p>';
							 htm +='<p>【沟通内容】:'+communicates.details+'</p>';
							 var list = data.offerRecords;
							 if(list!=null && list!=""){
								 for (var i = 0; i < list.length; i++) {
									htm +='<div class="col-sm-8"><h5>入职详情'+(i+1)+'</h5>'; 
									htm +='<p>【入职时间】:'+list[i].entryDate.substring(0,16)+' 【试用期】:'+list[i].probation+'</p>'; 
									htm +='<p>【入职岗位】:'+list[i].inPost+' 【入职薪酬】:'+list[i].entryPay+'</p></div>'; 
								}
							 }
						 }
					 }else{
						 var communicates = data.communicate;
						 if(communicates!=null && communicates!=""){
							 htm ='<div class="col-sm-8"><h5>'+data.title+'</h5>';
							 htm +='<p>【沟通时间】:'+communicates.communicationTime.substring(0,16) +'   【沟通目的】:'+communicates.purpose+'</p>';
							 htm +='<p>【沟通内容】:'+communicates.details+'</p>';
						 }
					}
					 $("#content").html(htm);
				 }
			 }
		});
	})
	</script>
</body>
</html>